Native multiarch support with backwards compatibility to osrf images#1120
Native multiarch support with backwards compatibility to osrf images#1120
Conversation
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
| if base_image.startswith('arm64v8/'): | ||
| platform_flag = 'linux/arm64' |
There was a problem hiding this comment.
Do we need this flag even if the image is already targeting the correct architecture?
I believe docker should be able to fetch the correct image based on the host OS.
If you do docker run -it ubuntu:noble uname -m it will automatically download the correct image if we are not doing cross-compilation.
|
For the transition to using the native multi arch docker images the main things we should provide are:
I think is a topic of discussion if we want this to be a flag the user has to set for the job to use emulation or if we want ros_buildfarm to work smarter and detect the arch drift and set the correct docker args. |
| add_argument_dockerfile_dir(parser) | ||
| add_argument_env_vars(parser) | ||
| add_argument_skip_tests(parser) | ||
| parser.add_argument( |
There was a problem hiding this comment.
We should invert this argument and set the new way as default with a specific argument to fallback to the previous ways.
| if arch in ['i386', 'armhf', 'arm64'] and not vars().get('use_official_docker_images', False): | ||
| base_image = 'osrf/%s_%s:%s' % (os_name, arch, os_code_name) | ||
| elif arch == 'arm64' and vars().get('use_official_docker_images', False): | ||
| base_image = 'arm64v8/%s:%s' % (os_name, os_code_name) |
There was a problem hiding this comment.
Even though this naming is correct I think it's unnecessary since in modern docker the architecture resolution is done based on the image pull.
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Partially generated using Gemini 3.0 Pro Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
|
So, with the last changes, I have the following results for amd and arm amd64 (my workstation)Running: arm64 (testfarm agent)Running: arm64_job.sh Note in What I think I'm missing is the possibility of using I added Looking for another review and ideas now @cottsay @claraberendsen |
|
@claraberendsen suggestion:
Maybe we can do instead (as we're not actually doing a prefix, but the image without the tag): - --docker-image-prefix
+ --docker-image |
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
|
With the current changes now running: |
ros_buildfarm/scripts/release/create_binarydeb_task_generator.py
Outdated
Show resolved
Hide resolved
ros_buildfarm/templates/release/deb/binarypkg_create_task.Dockerfile.em
Outdated
Show resolved
Hide resolved
ros_buildfarm/templates/release/deb/binarypkg_create_task.Dockerfile.em
Outdated
Show resolved
Hide resolved
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Co-authored-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
No description provided.